//
//  UIColor+NBCExpand.m
//  Pods
//
//  Created by 叶青 on 2017/3/7.
//
//

#import "UIColor+NBCExpand.h"

@implementation UIColor (NBCExpand)


#pragma mark - class method
+(UIColor *)nbc_colorWithRGB:(UInt32)hex
{
    int r = (hex >> 16) & 0xFF;
    int g = (hex >> 8) & 0xFF;
    int b = (hex) & 0xFF;
    return [UIColor colorWithRed:r / 255.0f
                           green:g / 255.0f
                            blue:b / 255.0f
                           alpha:1.0f];
}


+(UIColor *)nbc_colorWithRGBA:(UInt32)hex
{
    int red, green, blue, alpha;
    blue = hex & 0x000000FF;
    green = ((hex & 0x0000FF00) >> 8);
    red = ((hex & 0x00FF0000) >> 16);
    alpha = ((hex & 0xFF000000) >> 24);
    return [UIColor colorWithRed:red/255.0f
                           green:green/255.0f
                            blue:blue/255.0f
                           alpha:alpha/255.f];
}
@end
